home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Plug-In Power Pack for Netscape Communicator
/
Plug-In Power Pack for Netscape Communicator.iso
/
plugins
/
dataviews
/
dvtools
/
demos
/
citydemo
/
c4i_popups.c
< prev
next >
Wrap
C/C++ Source or Header
|
1997-05-08
|
3KB
|
137 lines
#ifndef lint
static char SccsId[]= "@(#)c4i_popups.c V1.5 3/31/92";
#endif
/*------------------------------------------------------------------
| file name -- c4i_popups.c
|
| functions Description
| --------- -----------
| CreatePopupDps Sizes the information popup drawports
| ResizeThisPopup Resizes a particular popup
| ResizePopups Resizes the popups
| RedrawPopups Redraws the popups
|
|-----------------------------------------------------------------*/
#include "std.h"
#include "dvstd.h"
#include "Tfundecl.h"
#include "c4i_vars.h"
#include "VOfundecl.h"
#include "c4i_fundecl.h"
extern FLOAT Intro1;
/*==================================================
CREATE_POPUP_DPS();
This does what it says!
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
*/
void
CreatePopupDps V_P_ ((void))
{
INT i;
OBJECT drawing;
VIEW view;
RECTANGLE vp_delta;
for (i = 0; i < NUM_POPUP_DP; i++)
{
view = TviLoad (SamplePopupVu[i]);
EXIT2_IF_INVALID (view, "This POPUP view not found -->", SamplePopupVu[i]);
drawing = TviGetDrawing (view);
/* Get box around all objects and expand for round-off. */
(VOID) VOobBox (drawing, &Pvp_drawing[i], &vp_delta);
Pvp_drawing[i].ll.x--;
Pvp_drawing[i].ll.y--;
Pvp_drawing[i].ur.x--;
Pvp_drawing[i].ur.y--;
/* Find screen coords and virtual coords. */
GetCoords (ActiveDrawport, &Pvp_drawing[i], &Pdd_scr_coords[i],
&Pvp_screen[i]);
}
}
/* END CREATE_POPUP_DPS() */
/*==================================================
RESIZETHISPOPUP();
This does what it says!
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
*/
void
ResizeThisPopup (p_class)
int p_class;
{
/* Find screen coords and virtual coords. */
GetCoords (CalculatingDp[ZoomeD], &Pvp_drawing[p_class],
&Pdd_scr_coords[p_class], &Pvp_screen[p_class]);
(VOID) TdpResize (DisplayList->PopupDp[p_class], &Pvp_screen[p_class]);
}
/*==================================================
RESIZEPOPUPS();
This does what it says!
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
*/
void ResizePopups
V_P_ ((void))
{
INT i;
for (i = 0; i < NUM_POPUP_DP; i++) /*for each existing popup... */
if (DisplayList->PopupDp[i])
{
/* Find screen coords and virtual coords. */
GetCoords (CalculatingDp[ZoomeD], &Pvp_drawing[i], &Pdd_scr_coords[i],
&Pvp_screen[i]);
(VOID) TdpResize (DisplayList->PopupDp[i], &Pvp_screen[i]);
}
}
/*==================================================
REDRAWPOPUPS( a );
if a=YES then use TdpDraw
else use TdpRedraw
This does what it says!
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
*/
void
RedrawPopups (requested_TdpDraw)
BOOLPARAM requested_TdpDraw;
{
INT i;
if (requested_TdpDraw)
{
for (i = 0; i < NUM_POPUP_DP; i++)
if (DisplayList->PopupDp[i])
(VOID) TdpDraw (DisplayList->PopupDp[i]);
}
else
{
for (i = 0; i < NUM_POPUP_DP; i++)
if (DisplayList->PopupDp[i])
(VOID) TdpRedraw (DisplayList->PopupDp[i], DEFAULT_PORTION, YES);
}
}
/* END REDRAWPOPUPS */